// 定义变量时，在变量名后面使用 :类型 来指定变量的类型

// 字符串类型
let userName: string = "张三";
// 数字类型
let userAge: number = 18;
// 布尔类型
let isOK: boolean = true;

// 数组类型
let numbers: number[] = [1, 2, 3];
let names: string[] = ["李四", "王五"];

let anything: any = "可以是字符串";
anything = 123; // 后来可以改为数字

function changeNameToUpper(name: string): string {
    return name.toUpperCase();
}

let result = changeNameToUpper(userName);
console.log(result);

console.log(userName);
console.log(userAge);
console.log(isOK);
console.log(numbers);
console.log(names);
console.log(anything);